//
//  ZZDetailModel.m
//  ZeroCorner
//
//  Created by lanou3g on 15/11/19.
//  Copyright © 2015年 Zero_Zhou. All rights reserved.
//

#import "ZZDetailModel.h"
#import "ZZDetailingModel.h"
@implementation ZZDetailModel
/**
 * 便利构造器
 */

+ (instancetype)detailWithDict:(NSDictionary *)dict
{
    ZZDetailModel *detail = [[self alloc]init];
    detail.title = dict[@"title"];
    detail.ptime = dict[@"ptime"];
    detail.body = dict[@"body"];
    
    NSArray *imgArray = dict[@"img"];
    NSMutableArray *temArray = [NSMutableArray arrayWithCapacity:imgArray.count];
    
    for (NSDictionary *dict in imgArray) {
        ZZDetailingModel *imgModel = [ZZDetailingModel detailImgWithDict:dict];
        [temArray addObject:imgModel];
    }
    detail.img = temArray;
    
    return detail;
}

@end
